<template>
  <div>
    <el-row :gutter="10" class="mb8">
      <el-col :span="1.5">
        <el-button
          type="primary"
          plain
          icon="el-icon-download"
          @click="handleGenTable"
        >生成
        </el-button>
      </el-col>
      <el-col :span="1.5">
        <el-button
          type="info"
          plain
          icon="el-icon-upload"
          @click="openImportTable"
        >导入
        </el-button>
      </el-col>
      <el-col :span="1.5">
        <el-button
          type="success"
          plain
          icon="el-icon-edit"
          :disabled="single"
          @click="handleEditTable"
          v-hasPermi="['tool:gen:edit']"
        >修改
        </el-button>
      </el-col>
      <el-col :span="1.5">
        <el-button
          type="danger"
          plain
          icon="el-icon-delete"
          :disabled="multiple"
          @click="handleDelete"
          v-hasPermi="['tool:gen:remove']"
        >删除
        </el-button>
      </el-col>
      <right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
    </el-row>
  </div>
</template>

<script>
  import {mapState} from 'vuex';

  export default {
    computed: {
      ...mapState({genTableState: state => state.GenTable})
    },
    methods: {
      addEvent() {
        this.genTableState.dialogType = 'add';
        this.genTableState.dialogShow = true;
        this.plugins.resetObjectValue(this.genTableState.dialogData);
      },
      resetSearchForm() {
        this.genTableState.searchForm.account = "";
        this.$emit('getTableList', 1)
      },
      openImportTable(){
        this.genTableState.importTableShow = true;
      },
      handleGenTable(){
        this.$emit('handleGenTable')
      }
    }
  }
</script>

<style scoped>

</style>
